package org.diysearch.models;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.solr.client.solrj.beans.Field;
import org.diysearch.interfaces.Constants;
import org.diysearch.interfaces.Model;
import org.diysearch.interfaces.Taggable;

public class Link extends BaseModel implements Model, Taggable {
	
	@Field
	private int id;
	
	@Field
	private String title;
	
	@Field
	private String url;
	
	@Field
	private String description;
	
	private int owner;
	private int category;
	
	private Category _cat;

	private User _user;
	private int isActive;
	private int editorPick;
	private int rating;
	private int clickThrus;
	private int impressions;
	private Date dateAdded;
	private Date dateLastModified;
	
	private List<Tag> tags;
	private List<Comment> comments;
	
	@Field("category")
	private String _category;
	private String[] facets;
	
	@Field("tags")
	private Object[] _tags;
	private float score; 
	
	public Link() {
		tags = new ArrayList<Tag>();
		comments = new ArrayList<Comment>();
	}
	
	public Object[] get_tags() {
		return _tags;
	}

	public void set_tags(Object[] _tags) {
		this._tags = _tags;
	}

	public String get_category() {
		return _category;
	}

	public void set_category(String _category) {
		this._category = _category;
	}

	public String[] getFacets() {
		return facets;
	}

	public void setFacets(String[] facets) {
		this.facets = facets;
	}

	public float getScore() {
		return score;
	}

	public void setScore(float score) {
		this.score = score;
	}

	public List<Comment> getComments() {
		return comments;
	}

	public void setComments(List<Comment> comments) {
		this.comments = comments;
	}

	@Override
	public int getObjectId() {
		// TODO Auto-generated method stub
		return Constants.LINKS_OBJECT_ID;
	}

	@Override
	public String getUri() {
		// TODO Auto-generated method stub
		return "/post";
	}

	@Override
	public int getItemId() {
		// TODO Auto-generated method stub
		return id;
	}

	@Override
	public void setItemId(int item) {
		this.id = item;
		
	}

	public List<Tag> getTags() {
		return tags;
	}

	public void setTags(List<Tag> tags) {
		this.tags = tags;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getOwner() {
		return owner;
	}

	public void setOwner(int owner) {
		this.owner = owner;
	}

	public int getCategory() {
		return category;
	}

	public void setCategory(int category) {
		this.category = category;
	}

	public Category get_cat() {
		return _cat;
	}

	public void set_cat(Category _cat) {
		this._cat = _cat;
	}

	public User get_user() {
		return _user;
	}

	public void set_user(User _user) {
		this._user = _user;
	}

	public int getIsActive() {
		return isActive;
	}

	public void setIsActive(int isActive) {
		this.isActive = isActive;
	}

	public int getEditorPick() {
		return editorPick;
	}

	public void setEditorPick(int editorPick) {
		this.editorPick = editorPick;
	}

	public int getRating() {
		return rating;
	}

	public void setRating(int rating) {
		this.rating = rating;
	}

	public int getClickThrus() {
		return clickThrus;
	}

	public void setClickThrus(int clickThrus) {
		this.clickThrus = clickThrus;
	}

	public int getImpressions() {
		return impressions;
	}

	public void setImpressions(int impressions) {
		this.impressions = impressions;
	}

	public Date getDateAdded() {
		return dateAdded;
	}

	public void setDateAdded(Date dateAdded) {
		this.dateAdded = dateAdded;
	}

	public Date getDateLastModified() {
		return dateLastModified;
	}

	public void setDateLastModified(Date dateLastModified) {
		this.dateLastModified = dateLastModified;
	}

	@Override
	public String getAliasName() {
		// TODO Auto-generated method stub
		return "link";
	}

}
